<?php
class UserShareLogController extends CommonController{
	public function index() {
		$db = M ( $this->table );
		$count = $db->count (); // 计算总数
		$p = new Page ( $count );
		$list = $db->order ( $this->order )->limit ( $p->firstRow . ',' . $p->listRows )->select ();
		$page = $p->show ();
		$this->assign ( "page", $page );
		$this->assign ( "list", $list );
		
		$user_id_list=array();
		foreach($list as $v){
			$user_id_list[]=$v['uid'];
			$user_id_list[]=$v['user_id'];
		}
		if(!empty($user_id_list)){
			$userList=M('User')->oneField('username','id')->where("id in (".implode($user_id_list).")")->select();
			$this->assign('userList',$userList);
		}
		
		$this->display ( $this->tpl );
	}
}